package com.zhz.mall.common.annotation;


import com.zhz.mall.common.constraints.TypeLevelDefaultValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * 存在
 *
 * @author zhouhengzhe
 * @version 1.0.0
 */
@Target({TYPE})
@Retention(RUNTIME)
@Repeatable(TypeLevelValid.List.class)
@Documented
@Constraint(validatedBy = {TypeLevelDefaultValidator.class})
public @interface TypeLevelValid {

    String message() default "{com.ygp.its.infrastructure.utils.validation.constraints.StringContains}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};


    @Target({TYPE})
    @Retention(RUNTIME)
    @Documented
    @interface List {

        TypeLevelValid[] value();
    }
}
